{extend name='admin@main'}

{block name="button"}

<button data-open='{:url("add")}?activity_id={$activity_id}' data-title="添加组别" class='layui-btn layui-btn-sm layui-btn-primary'>添加组别</button>

<button data-action='{:url("del")}' data-rule="id#{key}" data-csrf="{:systoken('activity/group/del')}"
        data-confirm="确定要删除这些组别吗？" class='layui-btn layui-btn-sm layui-btn-primary'>删除组别
</button>

{/block}

{block name="content"}
<table class="layui-table" lay-skin="line">
    <caption class="margin-bottom-10 text-left">{include file='group/index_search'}</caption>
    {notempty name='list'}
    <thead>
    <tr>
        <th class='list-table-check-td think-checkbox'>
            <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
        </th>
        <th class='text-left nowrap' style="">ID</th>
        <th class='text-left nowrap' style="">组别名称</th>
        <th class='text-left nowrap' style="">原价</th>
        <th class='text-left nowrap' style="">价格</th>
        <th class='text-left nowrap' style="">数量</th>
        <th class='text-left nowrap' style="">状态</th>
        <th class='text-left nowrap' style="">创建时间</th>
        <th class='text-left nowrap'></th>
    </tr>
    </thead>
    {/notempty}
    <tbody>
    {foreach $list as $key=>$vo}
    <tr data-dbclick>
        <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'>
        </td>
        <td class='text-left nowrap'>
            {$vo.id|default=''}
        </td>
       <td class='text-left nowrap'>
            {$vo.name|default=''}
        </td>
        <td class='text-left nowrap'>
            {$vo.list_price|default=''}
        </td>
        <td class='text-left nowrap'>
            {$vo.price|default=''}
        </td>
        <td class='text-left nowrap'>
            {$vo.count|default=''}
        </td>
        <td class='text-left nowrap'>
            {$statusTitle[$vo['status']]|default=''}
        </td>
        <td class='text-left nowrap'>
            {$vo.create_time}
        </td>
        <td class='text-left nowrap'>
            {if auth("activity/group/edit")}
            <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑组别" data-open='{:url("edit")}?id={$vo.id}&activity_id={$activity_id}'>编
                辑</a>
            {/if}

            {if auth("activity/group/del")}
            <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该组别吗？" data-action="{:url('del')}"
               data-value="id#{$vo.id}" data-csrf="{:systoken('activity/group/del')}">删 除</a>
            {/if}
        </td>
    </tr>
    {/foreach}
    </tbody>
</table>

{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

{/block}
